﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace NinjaToolbox.PhysicsSystem
{
    [Serializable]
    public sealed class PhysicsShapeContainer
    {
        [SerializeField]
        EPhysicsShapeType mType = EPhysicsShapeType.Box;
        [SerializeField]
        BoxShape mBoxShape = new BoxShape() { size = new Vector3(1f, 1f, 1f) };
        [SerializeField]
        SphereShape mSphereShape = new SphereShape() { radius = 1f };
        [SerializeField]
        VirtualCapsuleShape mVirtualCapsuleShape = new VirtualCapsuleShape() { height = 2f, radius = 1f, virtualSegment = 1 };


        public IPhysicsShape GetPhysicsShape()
        {
            switch (mType)
            {
                case EPhysicsShapeType.Box:
                    return mBoxShape;
                case EPhysicsShapeType.Sphere:
                    return mSphereShape;
                case EPhysicsShapeType.VirtualCapsule:
                    return mVirtualCapsuleShape;
            }

            return null;
        }
    }
}
